Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving sms conversations into crm task #72

Closed
wants to merge 1 commit into from

Conversation

VSydor
Copy link
Contributor

@VSydor VSydor commented Jul 27, 2022

…roller for manual testing

@VSydor VSydor requested a review from brmeyer July 27, 2022 22:16
@VSydor VSydor changed the title [WIP] Draft: Saving sms conversations into crm task; Added temp method in crm cont… Draft: Saving sms conversations into crm task; Added temp method in crm cont… Aug 2, 2022
@VSydor VSydor changed the title Draft: Saving sms conversations into crm task; Added temp method in crm cont… WIP: Saving sms conversations into crm task; Added temp method in crm cont… Aug 8, 2022
@VSydor VSydor changed the title WIP: Saving sms conversations into crm task; Added temp method in crm cont… WIP: Saving sms conversations into crm task Aug 9, 2022
@Override
public EnvironmentConfig.CRMFieldDefinitions getFieldDefinitions() {
return this.env.getConfig().salesforce.fieldDefinitions;
}

protected void setTaskFields(SObject task, CrmTask crmTask) {
task.setField("Id", crmTask.id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's technically a setId method. But, I vaguely remember the API might reject this if the Id is explicitly set as null, so might need a null/empty check around this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added null check

.collect(Collectors.joining(","));
}

crmTask.assignTo = "0057Q000000M8FzQAK"; // me
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shift to env.json?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}

crmTask.assignTo = "0057Q000000M8FzQAK"; // me
crmTask.status = CrmTask.Status.IN_PROGRESS;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OPEN

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


import java.util.List;

public class CrmActivity {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little confused about the difference between CrmActivity, CrmTask, and why we need both. Lean into that for me?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VSydor Thoughts on this one?

Copy link
Contributor Author

@VSydor VSydor Dec 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brmeyer The idea is that crmActivity is a sub-type of crmTask that has crmActivityType (conversation or email) and conversationId fields. However, when converting to crmTask - these 2 fields just form the subject of the task (type + ":" + conversationId) so technically it's the same thing.

should I work directly with task and remove crmActivity?

Copy link
Contributor Author

@VSydor VSydor Dec 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without CrmActivity will look like this:
#98

Please select the one that fits best

@@ -172,6 +173,9 @@ default void updateContact(OpportunityEvent opportunityEvent) throws Exception {
Optional<CrmUser> getUserById(String id) throws Exception;
Optional<CrmUser> getUserByEmail(String email) throws Exception;
String insertTask(CrmTask crmTask) throws Exception;
String updateTask(CrmTask crmTask) throws Exception;
String upsertActivity(CrmActivity crmActivity) throws Exception;
Optional<CrmActivity> getActivityByTypeAndConversationId(CrmActivity.Type type, String conversationId) throws Exception;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this more generic? by type and an abstract notion of an ID? External ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to external id

@VSydor VSydor force-pushed the feature/sms-conversation-in-crm-task branch from 333e589 to b49c48a Compare November 22, 2022 07:23
@VSydor VSydor changed the title WIP: Saving sms conversations into crm task Saving sms conversations into crm task Nov 22, 2022
@VSydor VSydor force-pushed the feature/sms-conversation-in-crm-task branch 2 times, most recently from 2c60802 to ee7d368 Compare November 22, 2022 08:01
@VSydor VSydor force-pushed the feature/sms-conversation-in-crm-task branch from ee7d368 to 907f480 Compare November 22, 2022 08:04
@VSydor VSydor self-assigned this Nov 22, 2022
@VSydor
Copy link
Contributor Author

VSydor commented Dec 8, 2022

Closing in favor of:
#98

@VSydor VSydor closed this Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants